<!DOCTYPE html>
<html lang="zh-cmn-Hans-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>选项卡</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        #app {
            width: 400px;
            padding: 50px;
        }
        ul{
            display: flex;
            flex-flow: row nowrap;
            list-style: none;
        }
        ul li{
            width: 100px;
            text-align: center;
            color: #ffffff;
            border-radius: 5px 5px 0 0;
        }
        .box{
            box-shadow: 0 15px 10px #888888;
            height: 200px;
            color: #ffffff;
            border-radius: 0 10px 10px 10px;
            padding: 10px;
        }
        #panel1{
            background-color: #f16565;

        }
    </style>
</head>
<body>
<div id="app">
    <ul>
        <li :style="nav1Style" v-on:click="doChange(1)">
            工作技能
        </li>
        <li :style="nav2Style" @click="doChange(2)">
            工作积极性
        </li>
    </ul>
    <div id="panel1" class="box" :style="pnl1Style">
        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    </div>
    <div id="panel2" class="box" :style="pnl2Style">
        BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
    </div>
</div>
<script src="./js/vue.min.js"></script>
<script>
    var vm = new Vue({
        el: "#app",
        data: {
            nav1Style: {
                background: "#f16565"
            },
            nav2Style: {
                background: "#5757fc"
            },
            pnl1Style: {
                display: "none",
                background: "#f16565"
            },
            pnl2Style: {
                display: "none",
                background: "#5757fc"
            }
        },
        methods: {
            doChange: function (index) {
                if (index == 1) {
                    this.pnl1Style = {
                        display: "block",
                        background: "#f16565"
                    },
                    this.pnl2Style = {
                        display: "none"
                    }
                }else {
                    this.pnl2Style = {
                        display: "block",
                        background: "#5757fc"
                    },
                    this.pnl1Style = {
                        display: "none"
                    }

                }
            }
        }
    });
</script>
</body>
</html>
